﻿namespace LinkedTU.Models
{
    using LinkedTU.Common.Constants;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    public class ProfileInfo
    {
        private ICollection<Job> experience;
        private ICollection<UserSkill> skills;
        private ICollection<Recommendation> recommendations;
        private ICollection<Certificate> certificates;
        private ICollection<TakenCourse> coursesTaken;
        private ICollection<Project> projects;
        private ICollection<Language> languages;

        public ProfileInfo()
        {
            this.experience = new HashSet<Job>();
            this.skills = new HashSet<UserSkill>();
            this.recommendations = new HashSet<Recommendation>();
            this.projects = new HashSet<Project>();
            this.languages = new HashSet<Language>();
        }

        [Key, ForeignKey("User")]
        public string UserId { get; set; }

        public virtual ApplicationUser User { get; set; }

        [Required]
        [MaxLength(ValidationConstants.MaxNameLength)]
        [MinLength(ValidationConstants.MinNameLength)]
        public string FirstName { get; set; }

        [Required]
        [MaxLength(ValidationConstants.MaxNameLength)]
        [MinLength(ValidationConstants.MinNameLength)]
        public string LastName { get; set; }

        [MinLength(ValidationConstants.MinProfileSummaryLength)]
        [MaxLength(ValidationConstants.MaxProfileSummaryLength)]
        public string Summary { get; set; }

        [MaxLength(ValidationConstants.MaxHeadlineLength)]
        public string Headline { get; set; }

        public virtual Country Country { get; set; }

        public virtual City City { get; set; }

        public virtual ICollection<Job> Experience
        {
            get { return this.experience; }
            set { this.experience = value; }
        }

        public virtual ICollection<UserSkill> Skills
        {
            get { return this.skills; }
            set { this.skills = value; }
        }

        public virtual ICollection<Recommendation> Recommendations
        {
            get { return this.recommendations; }
            set { this.recommendations = value; }
        }

        public virtual ICollection<Language> Languages
        {
            get { return this.languages; }
            set { this.languages = value; }
        }

        public virtual ICollection<Certificate> Certificates
        {
            get { return this.certificates; }
            set { this.certificates = value; }
        }

        public virtual ICollection<TakenCourse> CoursesTaken
        {
            get { return this.coursesTaken; }
            set { this.coursesTaken = value; }
        }

        public virtual ICollection<Project> Projects
        {
            get { return this.projects; }
            set { this.projects = value; }
        }
    }
}
